package com.hp.his.basic.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.hp.his.basic.entity.Question;
import com.hp.his.core.orm.hibernate.HibernateDao;

@Repository
public class QuestionDao extends HibernateDao<Question, Long>{
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Question getQuestionById(Integer quesId){
		//定义查询语句
		String hql = "from Question where questionId="+quesId;
		Query query = getSession().createQuery(hql);
		
		List list = query.list();
		
		return (Question)list.get(0);
	}
}
